#include<iostream>
#include<map>
using namespace std;
map<string,int> s1={{"ChuiZi",0},{"Bu",1},{"JianDao",2}};
string s2[3]={"ChuiZi","Bu","JianDao"};
int n,cnt;
string str;
int main()
{
	cin>>n;
	while(cin>>str)
	{
		int op=(s1[str]+1)%3;
		if(cnt==n)
		{
			cnt=0;
			cout<<str<<endl;
		}
		else
		cnt++,cout<<s2[op]<<endl;
	}
	return 0;
}
